<%-- 
    Document   : TCubeHome
    Created on : Sep 27, 2011, 8:01:21 AM
    Author     : Belinda
--%>

<%@page import="EntityState.PartnerAccountState"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="java.util.ArrayList, BusinessLogic.Constants, EntityState.TCubeAccountState" %>
<!DOCTYPE html>
<html>
    <!-- InstanceBegin template="../TransactWeb/Templates/FdSageAdmin.dwt" codeOutsideHTMLIsLocked="false" -->
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <!-- InstanceBeginEditable name="doctitle" -->
        <title>TCube Homepage</title>
        <script type="text/javascript" src="../TransactWeb/js/detect_timezone.js"></script>
        

        <!-- InstanceEndEditable -->
        <script language="javascript" type="text/javascript" src="../TransactWeb/js/jquery-1.6.4.min.js"></script>
        <script type="text/javascript" src="../TransactWeb/js/fieldsetCollapse.js"></script>
        <script type="text/javascript" src="../TransactWeb/js/tcubmenu.js"></script>
        <link rel="stylesheet" type="text/css" href="../TransactWeb/css/tcubaccd.css" />
        <link rel="stylesheet" type="text/css" href="../TransactWeb/css/gridsys.css" />
        <link rel="stylesheet" type="text/css" href="../TransactWeb/css/reset1.css" />
        <link rel="stylesheet" type="text/css" href="../TransactWeb/css/cm.css" />
        <link href="../TransactWeb/css/tcube.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
        <div class="container_12">
            <!-- Header Nav -->
            <div class="grid_3"><img src="../TransactWeb/img/reservation/foodsglogo.png" width="146" height="178" /></div>
            <div class="grid_9 nav"><table width="600" border="0">
                    <tr>
                        <td width="89"><a href="TCubeHome">Home</a></td>
                        <td width="104"><a href="CreateMerchantAccount">Register</a></td>
                        <td width="125">Contact Us</td>
                        <td width="76">FAQ</td>
                        <td width="172">Login</td>
                    </tr>
                </table>
            </div>

            <div class="grid_12">
                <hr size="3" color="#CC6600" />
            </div>


            <!-- End of Header Nav -->
            <!-- Content -->
            <div class="grid_8 push_3 content">

                <!-----------------------------------------------------------------------------------------------------------------> 
                <%
                    ArrayList data = (ArrayList) request.getAttribute("data");
                    int result = ((Integer) data.get(0)).intValue();
                    if (result == Constants.STATUS_NEW_SESSION) {
                %>

                <script type="text/javascript">
                    $(document).ready(function () {
                        var tz = jstz.determine_timezone();
                        var jsTz = tz.name();
                        document.TCubeLogin.timezone.value = jsTz;
                    });
                </script>
                <!--Login -->
                <form action="https://localhost:8181/portal/business/PartnerLoginStatus" name="TCubeLogin" method="post">
                    <input type="hidden" id="currentURL" name="currentURL" />
                    <input type="hidden" name="timezone" id="timezone"/>
                    <table width="600" border="0" style="padding:10px 0px 10px 0px;">
                        <tr>
                            <td>
                                Username :
                            </td>
                            <td>
                                <input name="username" id="username" type="text" /> &nbsp;&nbsp; 
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Password :
                            </td>
                            <td>
                                <input name="password" id="password" type="password" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <input name="login" type="submit" value="Login" />
                            </td>
                        </tr>

                    </table>
                </form>
                <!--End Login -->
            </div>
            <!-- End Content -->

            <%  } else {
                PartnerAccountState pas = (PartnerAccountState) session.getAttribute("partner");
            %>
<div class="grid_12 welcome">Welcome <%= pas.getFirstName() + ", " + pas.getLastName() %>!</div>
<!-- End Welcome Message-->

<!-- End of Header Nav -->
<!-- Menu / Planner -->
<div class="grid_4">
    
<div id="leftnav"></div>
<script type="text/javascript">
    window.onload = showPage('partnerMenu', 'leftnav');
</script>

</div>
<div class="grid_8 content"></div>
            <%
                }
            %>

            <!-- Footer -->
            <div class="grid_12 footer">
                <hr size="3" color="#CC6600" />
                Copyright FoodSage 2011</div>
            <!-- End Footer-->
        </div>
    </body>
</html>
